#include "session.hpp"

Session::Session(const std::string& token, int userId, int expirySeconds)
    : token_(token)
    , userId_(userId)
    , createTime_(std::chrono::system_clock::now())
    , expiryTime_(createTime_ + std::chrono::seconds(expirySeconds))
{
}

std::string Session::getToken() const {
    return token_;
}

int Session::getUserId() const {
    return userId_;
}

std::chrono::system_clock::time_point Session::getCreateTime() const {
    return createTime_;
}

std::chrono::system_clock::time_point Session::getExpiryTime() const {
    return expiryTime_;
}

bool Session::isExpired() const {
    return std::chrono::system_clock::now() >= expiryTime_;
} 